package sys.model;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by shugen on 2017/1/18.
 * 问题表
 */
public class Question {
    private Integer id;  //id
    private Integer qid;//  对应的问卷id
    private String order;  //题号
    private String type;   //题型
    private String title;   // 题目
    private List<String> context;   //内容 选项

    public Question() {
        context=new ArrayList<String>();
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getQid() {
        return qid;
    }

    public void setQid(Integer qid) {
        this.qid = qid;
    }

    public String getOrder() {
        return order;
    }

    public void setOrder(String order) {
        this.order = order;
    }

    public String getType() {
        return type;
    }
    public String getTypeTo() {
        String Type="";
       switch(Integer.parseInt(type)){
           case 1:{Type="单选题";break;}
           case 2:{Type="多选题";break;}
           case 5:{Type="填空题";break;}
           case 6:{Type="完型题";break;}
           case 7:{Type="描述题";break;}
       }
        return Type;
    }
    public void setType(String type) {
        this.type = type;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContext() {
        return context.toString();
    }

    public void setContext(String context) {
        this.context.add(context) ;
    }

    @Override
    public String toString() {
        return "\n{" +
                "id=" + id +
                ", qid=" + qid +
                ", 题号='" + order + '\'' +
                ", 类型='" + getTypeTo() + '\'' +
                ", 标题='" + title + '\'' +
                ", 内容=" + context +
                '}';
    }
}
